// Explicit type conversion.
//
// 	Reverse transformation of implicit transformation.
// 	static_cast<target>(origin varible)
//
// 	Remove constant attribute.
// 	const_cast<target>(origin varible)
//
// 	Reinterpret type conversions.
// 	reinterpret_cast<target>(origin varible)

#include <iostream>
using namespace std;



int main( ) {
	int a; double b; float c; short d; char e;

	// All primitives can be implicitly converted between variables.
	a = b = c = d =e;

	// Other types of Pointers to void* can be implicitly converted.
	void* pv = &a;
	pv = &b;
	pv = &c;
	pv = &d;
	pv = &e;

	// void* to other types of Pointers must be forcibly rotated
	int* pa = static_cast<int*>(pv);
	double* pb = static_cast<double*>(pv);
	float* pc = static_cast<float*>(pv);
	short* pd = static_cast<short*>(pv);
	char* pe = static_cast<char*>(pv);

	// An extraordinary pointer of any type can be implicitly converted to a constant pointer of the same type.
	const int* cpa = pa;
	const double* cpb = pb;
	const float* cpc = pc;
	const short* cpd = pd;
	const char* cpe = pe;

	// A constant pointer of any type must be forcibly turned to an extraordinary pointer of the same type.
	pa = const_cast<int*>(pa);
	pb = const_cast<double*>(pb);
	pc = const_cast<float*>(pc);
	pd = const_cast<short*>(pd);
	pe = const_cast<char*>(pe);

	// Other than void*, Pointers of other types must be rotated strongly.i
	// It can not be static_cast or const_cast converted.
	pa = reinterpret_cast<int*>(pb);


	return 0;
}


